




let initBoard = [
    [3,7,0, 0,0,9, 0,6,2],
    [9,0,4, 0,2,6, 7,3,1],
    [2,6,1, 0,7,3, 0,0,0],

    [0,0,2, 6,0,4, 9,7,0],
    [7,0,9, 2,3,0, 0,0,0],
    [0,0,0, 7,9,8, 0,2,0],

    [8,1,3, 9,0,2, 0,0,7],
    [0,2,7, 0,8,0, 0,0,0],
    [0,9,0, 0,0,7, 2,8,0],
];


let unique = require('./unique'); // 唯一解
let uniqueMod = require('./uniqueMode'); // 余数法
let baseBc = require('./base_bc'); // 基础摒除法

let BoardInfo = require('./boardInfo');

function runSolver(){
    let methods = [unique,uniqueMod,baseBc];
    let info = new BoardInfo(initBoard);
    for(let i = 0; i < methods.length;++i){
        let func = methods[i];
        let result = func(info);
        if(result){
            console.log(`使用${func.name} 解决.result:${JSON.stringify(result)}`);
            return;
        }
    }
    console.log(`没有找到结果`);
}

runSolver();


